package cc.messcat.service.fupin;

import cc.messcat.common.model.Pager;
import cc.messcat.common.service.BaseService;
import cc.messcat.entity.fupin.Family;
import cc.messcat.entity.fupin.PoorFamily;
import cc.messcat.entity.fupin.PoorFamilyHistory;
import cc.messcat.entity.helpPerson.HelpPerson;
import cc.messcat.entity.system.McUser;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

public interface PoorFamilyService extends BaseService<PoorFamily>{

    public Pager<PoorFamily> getPager(int pageNo, int pageSize);
	
	public Long addPoorFamily(PoorFamily poorFamily);
	
	public void modifyPoorFamily(PoorFamily poorFamily);
	
	public void removePoorFamily(Long id);
	
	public PoorFamily get(Long id);
	
	public Pager<Map<String, Object>> getPFPager(int pageNo, int pageSize, PoorFamily poorFamily, String year,String name,String idNumber, String relation, McUser user) throws Exception;


	public Pager<PoorFamily> getPager(PoorFamily poorFamily, Integer pageNo, Integer pageSize,String name, String idNumber,String Whether,String year, McUser user);

	
	public Pager getPHPager(int pageNo, int pageSize, PoorFamily poorFamily, String year, String name, String idNumber, String groupNumber, McUser user);

	public List totalPoor();

	public Pager<?> complexQueryDuplicateID(Integer pageNo, Integer pageSize, String year, String country,McUser user);

	public String adduploadFile(String file, HttpSession session, McUser mcUser) throws Exception;
	
	public List<PoorFamily>  findCurrentPoorFamilyByCountry(String country);

	public List<PoorFamily>  findPoorFamilyByReason(String reason);
	
	public PoorFamily getPoorFamily(PoorFamily poorFamily);
	
	public HSSFWorkbook complexExportDuplicateIDExcel(Integer pageNo, Integer pageSize, String year, String country,McUser user);

	List<Family> findHouseholder(Integer... id);

	public Pager complexQueryExceptHouseholder(String year, String country, String village, Integer type,Integer PageNo, Integer pageSize,McUser user);

	HSSFWorkbook complexExportExceptHouseholder(String year, String country, String village, Integer type,McUser user);

	public Pager complexQueryPoorStudent(String year, String country, Family family, Integer pageNo, Integer pageSize,McUser user);

	HSSFWorkbook complexExportPoorStudent(String year, String country, Family family,McUser user);

	public List complexQueryIncomeInfo();
	
    public List queryMainPovertyCauses( );
    
	public Pager queryPoorPeople(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
	

    public HSSFWorkbook  exportPoorPeople(McUser user,String year,String town,String poverty);
    

    public Pager queryAgeGroup(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
    
    
    public HSSFWorkbook  exportAgeGroup(McUser user,String year,String town,String poverty);
    
    
    public Pager  queryWorkState(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
    
    
    public HSSFWorkbook  exportWorkState(McUser user, String year, String town, String poverty);
    
    
    public Pager  queryWorkTime(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
    
    
    public HSSFWorkbook  exportWorkTime(McUser user, String year, String town, String poverty);
    
    
    public Pager  queryInternalStudent(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
    
    
    public HSSFWorkbook  exportInternalStudent(McUser user,String year,String town,String poverty);
    
    
    public Pager  queryPoorStatus(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
    
    
    public HSSFWorkbook   exportPoorStatus(McUser user,String year,String town,String poverty);
    
    
    public Pager  queryMainPovertyCauses(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
    
    
    public HSSFWorkbook   exportMainPovertyCauses(McUser user,String year,String town,String poverty);
    
    
    public Pager  queryOtherPovertyCauses(McUser user,Integer pageNo,Integer pageSize,String year,String town,String poverty);
    
	
    public HSSFWorkbook   exportOtherPovertyCauses(McUser user,String year,String town,String poverty);
    
    
    public HSSFWorkbook exportPoorFamily(PoorFamily poorFamily, String year,String name,String idNumber,String relation,McUser user) throws Exception;



	public List<PoorFamily> poorfamilies(Long id);


	public HSSFWorkbook exportPoorFamilys(PoorFamily poorFamily, String name, String idNumber, String whether,String year,McUser user);

	
	
	public List<HelpPerson> queryFamilyhelpperson(Long id);

	public Pager populationStatistics(McUser user, Integer pageNo, Integer pageSize, String year, String country, String village,
		String poverty);

	HSSFWorkbook exportPopulationStatistics(McUser user, Integer pageNo, Integer pageSize, String year, String country, String village,
		String poverty);

	public Pager CPCStatistics(McUser user, Integer pageNo, Integer pageSize, String year, String country, String village,
		String poverty);

	public HSSFWorkbook exportCPCStatistics(McUser user, Integer pageNo, Integer pageSize, String year, String country,
		String village, String poverty);

	public HSSFWorkbook exportFindFamilyLiable(McUser user, Integer pageNo, Integer pageSize,  String year, String country,
			String village, String type);

	public Pager findFamilyLiable(McUser user, Integer pageNo, Integer pageSize, String year, String country,
			String village, String type);

	public HSSFWorkbook exportPoorFamilyZ(String year, PoorFamily poorFamily, McUser user, String name, String idNumber,
			String groupNumber);

	public Long addPoorFamilyHistofy(PoorFamilyHistory poorFamilyHistory);

	public PoorFamilyHistory getLatestPoorFamilyHistory(Long fid);

	public PoorFamilyHistory getPoorFamilyHistory(Long id);

	public Pager complexDuplicateIDNumberStatistics(Integer pageNo, Integer pageSize, String year, String country, McUser user);

	public HSSFWorkbook complexExportDuplicateIDNumberStatistics(int i, int j, String year, String country, McUser user);

	public  List<PoorFamily> getPoorFamilyByNumber(String number);

	public List<PoorFamily> getPoorFamilyByAreaID(Long id);

    Long getPoorFamilyCount(String annual,Long areaID);

	public List findPoorFamilyByVillageId(Long villageId);

	public Pager findPoorFamilyByCondition(Integer pageNo, Integer pageSize, String country, String village,String poorName ,String poorFamilyNum);
	/**根据户编号和年度查询贫困户 */ 
	public PoorFamily getPoorFamilyByNumberAndAnnual(String number, String annual);
}
